// 灯笼炸开粒子
  class BrightParticle {
    constructor (PIXI, parent, art, config, type, useParticleContainer, stepColors) {
      this.elapsed = Date.now();
      window.PIXI = PIXI;
      require('pixi-particles/dist/pixi-particles');
      let emitterContainer = null;
      if (useParticleContainer) {
        emitterContainer = new PIXI.ParticleContainer();
        emitterContainer.setProperties({
          scale: true,
          position: true,
          rotation: true,
          uvs: true,
          alpha: true
        });
      } else {
        emitterContainer = new PIXI.Container();
      }
      parent.addChild(emitterContainer);
      this.emitter = new PIXI.particles.Emitter(
        emitterContainer,
        art,
        config
      );
      if (stepColors) {
        this.emitter.startColor = PIXI.particles.ParticleUtils.createSteppedGradient(config.color.list, stepColors);
      }
      if (type === 'path') {
        this.emitter.particleConstructor = PIXI.particles.PathParticle;
      } else if (type === 'anim') {
        this.emitter.particleConstructor = PIXI.particles.AnimatedParticle;
      }
    }

    update () {
      let now = Date.now();
      if (this.emitter) {
        this.emitter.update((now - this.elapsed) * 0.001);
      }
      this.elapsed = now;
    }
  }

  export default BrightParticle;
//
// // Click on the canvas to trigger
// canvas.addEventListener('mouseup', function(e){
//   if(!emitter) return;
//   emitter.emit = true;
//   emitter.resetPositionTracking();
//   emitter.updateOwnerPos(e.offsetX || e.layerX, e.offsetY || e.layerY);
// });

// //for testing and debugging
// window.destroyEmitter = function()
// {
//   emitter.destroy();
//   emitter = null;
//   window.destroyEmitter = null;
//   //cancelAnimationFrame(updateId);
//
//   //reset SpriteRenderer's batching to fully release particles for GC
//   if (renderer.plugins && renderer.plugins.sprite && renderer.plugins.sprite.sprites)
//     renderer.plugins.sprite.sprites.length = 0;
//
//   renderer.render(stage);
